/*
 * @Author: TT-hzy
 * @Date: 2024-06-28 19:07:00
 * @LastEditors: TT-hzy 
 * @LastEditTime: 2024-07-04 14:39:00
 * @Description:
 */

import { Application } from "egg";

export default (app: Application) => {
    const {
        router,
        controller,
        middleware
    } = app;
    const jwt = middleware.jwtErr(app.config.jwt.secret);
    router.get("/user/list", controller.user.index);
    router.post("/user/register", controller.user.register);
    router.post("/user/login", controller.user.login);
    router.get("/user/info", jwt, controller.user.findUser);
    router.post("/user/update", jwt, controller.user.updateUserInfo);
};
